<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Finds whether a table name matches a wildcard pattern or not</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mysqlnd-ms-get-stats.html">mysqlnd_ms_get_stats</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mysqlnd-ms-query-is-select.html">mysqlnd_ms_query_is_select</a></div>
 <div class="up"><a href="ref.mysqlnd-ms.html">Mysqlnd_ms 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.mysqlnd-ms-match-wild" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mysqlnd_ms_match_wild</h1>
  <p class="verinfo">(PECL mysqlnd_ms &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">mysqlnd_ms_match_wild</span> &mdash; <span class="dc-title">Finds whether a table name matches a wildcard pattern or not</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mysqlnd-ms-match-wild-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> 
   <span class="methodname"><strong>mysqlnd_ms_match_wild</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$table_name</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$wildcard</code></span>
   )</div>

  <p class="para rdfs-comment">
    Finds whether a table name matches a wildcard pattern or not.
  </p>
  <p class="para">
   This function is not of much practical relevance with PECL mysqlnd_ms 1.1.0
   because the plugin does not support MySQL replication table filtering yet.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mysqlnd-ms-match-wild-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<em><code class="parameter">table_name</code></em></dt>

    <dd>

     <p class="para">
      The table name to check if it is matched by the wildcard.
     </p>
    </dd>

   
   
    <dt>
<em><code class="parameter">wildcard</code></em></dt>

    <dd>

     <p class="para">
      The wildcard pattern to check against the table name.
      The wildcard pattern supports the same placeholders as
      MySQL replication filters do.
     </p>
     <p class="para">
      MySQL replication filters
      can be configured by using the MySQL Server configuration
      options <em>--replicate-wild-do-table</em> and
      <em>--replicate-wild-do-db</em>. Please, consult
      the MySQL Reference Manual to learn more about this MySQL
      Server feature.
     </p>
     <p class="para">
      The supported placeholders are:
      <ul class="itemizedlist">
       <li class="listitem">
        <span class="simpara">
         <em>%</em> - zero or more literals
        </span>
       </li>
       <li class="listitem">
        <span class="simpara">
         <em>%</em> - one literal
        </span>
       </li>
      </ul>
     </p>
     <p class="para">
      Placeholders can be escaped using <em>\</em>.
     </p>
    </dd>

   
  </dl>

 </div>


<div class="refsect1 returnvalues" id="refsect1-function.mysqlnd-ms-match-wild-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> <em>table_name</em> is
   matched by <em>wildcard</em>.
   Otherwise, returns <strong><code>FALSE</code></strong>
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.mysqlnd-ms-match-wild-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1812">
    <p><strong>Example #1 <span class="function"><strong>mysqlnd_ms_match_wild()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"schema_name.table_name"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"schema%"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"abc"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"_"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"table1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"table_"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"asia_customers"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"%customers"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"funny%table"</span><span style="color: #007700">,</span><span style="color: #DD0000">"funny\%table"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">mysqlnd_ms_match_wild</span><span style="color: #007700">(</span><span style="color: #DD0000">"funnytable"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"funny%table"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
bool(true)
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mysqlnd-ms-get-stats.html">mysqlnd_ms_get_stats</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.mysqlnd-ms-query-is-select.html">mysqlnd_ms_query_is_select</a></div>
 <div class="up"><a href="ref.mysqlnd-ms.html">Mysqlnd_ms 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
